package com.liao.badminton.mapper;

import com.liao.badminton.code.*;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.liao.badminton.dto.UserGroupRefDto;
import com.liao.badminton.vo.StatVo;
import com.liao.badminton.vo.UserGroupRefVo;
import org.apache.ibatis.annotations.Mapper;
import com.liao.badminton.entity.UserGroupRef;
import org.apache.ibatis.annotations.Param;

import java.math.BigDecimal;
import java.util.List;

/**
* @author liaocheng
* @date 2024-10-31
* description:用户和群关系
*/
@Mapper
public interface UserGroupRefMapper extends BaseMapper<UserGroupRef> {
    int updateBy(UserGroupRef userGroupRef);
    int add(UserGroupRef userGroupRef);
    List<UserGroupRefVo> findByPageParam(PageParam<UserGroupRefDto> userGroupRefPageParam);
    int countByPageParam(PageParam<UserGroupRef> userGroupRefPageParam);
    int deletes(@Param("ids") List<Long> ids);
    List<UserGroupRef> findByIds(@Param("ids") List<Long> ids);
    void addBatch(List<UserGroupRef> list);
    UserGroupRef findById(@Param("id") Long id);
    List<UserGroupRef> findByParam(@Param("param") UserGroupRefDto param);

    List<StatVo> findUserRankListByGroupId( @Param("groupId")Long groupId, @Param("orderByType")Integer orderByType,@Param("orderByTypeDesc")Integer orderByTypeDesc,
     @Param("teamOneName")String teamOneName);

    StatVo findAllStat( @Param("currUserID")Long currUserID, @Param("groupId")Long groupId);

    List<String> findUserNamesByGroupId(Long groupId);

    List<KeyValue> findRankRateByGroupId(Long groupId);
    List<KeyValue> findAwardCoinByGroupId(Long groupId);
    List<KeyValue> findTotalScoreByGroupId(Long groupId);

    void updateActivityNum(@Param("ids") List ids,@Param("updateNum") int updateNum);

    void updateOutUserBy(Long id);

    void updateCost(@Param("ids") List<Long> userGId);
}

